/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package swingDemoEvent;

/**
 *
 * @author Administrator
 */
public class InterfaceDemo
{
	public static void main(String args[])
	{
	    //A a=new A();//接口不能生成对象
        B b =new B();
        b.show();
	}
}
 interface A {
    double g=9.8;
   void show();//抽象方法
   //void show1();
}

 class B implements A {
    int t = 5;
    public void show() {
        System.out.println(g);
        System.out.println(t);
        System.out.println("s=" + 0.5 * g * t * t);
    }
    
}
